{% extends "layout.html" %}
{% set now_title = '编辑管理员'%}

{% block web_title %}{{ now_title }}-{{ parent()}} {% endblock%}
{% block content%}
<div class="main-container">
	<!-- Top Bar Starts -->
	<div class="top-bar clearfix">
		<div class="page-title">
			<h4>
				<div class="fs1 iconfont icon-setting" aria-hidden="true"></div>
				{{ now_title }}
			</h4>
		</div>
	</div>
	<!-- Top Bar Ends -->
	<!-- Container fluid Starts -->
	<div class="container-fluid">
		<!-- Spacer starts -->
		<div class="spacer-xs">
			<div class="row no-gutter">
				<div class="col-md-12 col-sm-6 col-xs-12">
					<div class="panel panel-default">
						<div class="panel-heading">
							<h4>
								{{ now_title }}
							</h4>
						</div>
						<div class="panel-body">
							<form class="form-horizontal row-border" method="post" action="/admin/saveadmin">
								<input type="hidden" name="id" value="{{ data.data.id }}"
								/>
								<div class="form-group">
									<label class="col-md-2 control-label">
										用户名
									</label>
									<div class="col-md-10">
										<input type="text" name="username" class="form-control" value="{{ data.data.username }}" required="required" />
									</div>
								</div>
								<div class="form-group">
									<label class="col-md-2 control-label">
										密码
									</label>
									<div class="col-md-10">
										{% if data.data.password%}
										<input class="form-control" type="text" name="password" value="">
                                <span class="help-block">
                                  不修改密码请留空
                                </span>
										{% else  %}
										<?php else: ?>
										<input class="form-control" type="text" name="password" value="" required="required">
										{% endif %}
									</div>
								</div>
								<div class="form-group">
									<label class="col-md-2 control-label">
										是否可用
									</label>
									<div class="col-md-10">
										<select name="is_use" class="form-control">
											<option value="0" {%  if data.data.is_use == 0 %} selected = "selected" {% endif %} >可用</option>
											<option value="1" {%  if data.data.is_use == 1 %}  selected = "selected" {% endif %} >不可用</option>
										</select>
									</div>
								</div>
								<div class="form-group">
									<div class="col-md-10">
										<button type="submit" class="btn btn-info pull-right">
											提交
										</button>
									</div>
								</div>
							</form>
						</div>
					</div>
				</div>
			</div>
			<!-- row end -->
		</div>
		<!-- Spacer ends -->
	</div>
	<!-- Container fluid ends -->
</div>
<!-- Main Container Start -->
{% endblock%}